package template;

import logist.topology.Topology.City;

public class State {
	private City city;
	private City packetTo;
	private double value;
	private BestAction bestAction;
	private double lastValue; // Not part of the model, used in the function goodEnough() to facilitate the computation
	

	public State(City city, City packetTo, double value, BestAction bestAction) {
		super();
		this.city = city;
		this.packetTo = packetTo;
		this.value = value;
		this.bestAction = bestAction;
		this.lastValue = value;
	}

	public City getCity() {
		return city;
	}

	public void setCity(City city) {
		this.city = city;
	}

	public double getValue() {
		return value;
	}

	public void setValue(double v) {
		lastValue = value;
		value = v;
	}

	public BestAction getBestAction() {
		return bestAction;
	}

	public void setBestAction(BestAction bA) {
		this.bestAction = bA;
	}

	public double getLastValue() {
		return lastValue;
	}

	public City getPacketTo() {
		return packetTo;
	}

	public String toString() {
		return "State: In city " + city + " with packet to "+ packetTo +". Value: " + value + ". Best Action: "
				+ bestAction;
	}

}
